import { CircleDetailResult, CircleFileListResult, CircleListResult, CircleMemberListResult } from "@/api/contact/types"
import { FileUploadPolicyEnum } from "@/enums/PublicEnum"

/** 选择圈子 */
export type SelectCircles = {
  selected: number[]
  success: (selected: CircleListResult[]) => void
}

/** 圈子详情 */
export type CircleDetail = {
  uuid: string
  success?: () => void
}

/** 圈子设置 */
export type CircleSetting = {
  uuid: string
  success: (type: 'baseInfo' | 'memberList') => void
}

/** 圈子信息 */
export type EditCircleInfo = {
  uuid: string
  success: (data: Pick<CircleDetailResult, 'name' | 'description' | 'avatar'>) => void
}

/** 圈子文件上传限制 */
export type CircleFileUploadLimit = {
  id: number
  fileUploadPolicy: FileUploadPolicyEnum;
  success: (data: { fileUploadPolicy: FileUploadPolicyEnum }) => void
}

/** 选择成员 */
export type SelectMembers = {
  id: number
  selected: number[]
  /** 选择类型 管理员/成员 */
  type: 'admin' | 'member'
  success: (data: CircleMemberListResult[]) => void
}

/** 转移超管权限 */
export type TransferSuperAdmin = {
  id: number
}

/** 圈子管理员管理 */
export type CircleAdminManagement = {
  id: number
  success: (num: number) => void
}

/** 圈子成员设置 */
export type CircleMemberSetting = {
  memberId: number
  success: () => void
}

/** 选择成员身份 */
export type SelectMemberIdentity = {
  circleId: number
  selected?: number
  success: (data?: { id: number, name: string }) => void
}

/** 添加圈子共享文件 */
export type AddCircleSharedFile = {
  circleId: number
  success: (addNum: number) => void
}

/** 圈子文件设置 */
export type CircleFileSetting = {
  data: CircleFileListResult
  circleId: number
  success: (type?: 'delete' | 'update') => void
}

